package com.heima.Client;


import com.heima.Client.fallback.ItemClientFallback;
import com.heima.config.DefaultFeignConfig;
import com.heima.dto.ItemDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;


@FeignClient(value = "item-service",
        fallbackFactory = ItemClientFallback.class,
        configuration = DefaultFeignConfig.class)
public interface ItemClient {

    @GetMapping("/items")
    List<ItemDTO> queryItemByIds(@RequestParam("ids") Collection<Long> ids);
}